package com.cyandpos.pad.cateringformat.morefunction.presenter;

import com.cyandpos.pad.cateringformat.morefunction.model.OrderFoodInfoModel;
import com.cyandpos.pad.cateringformat.morefunction.model.OrderFoodInfoModelImpl;
import com.cyandpos.pad.cateringformat.morefunction.view.OrderFoodInfoView;
import com.cyandpos.pad.posdata.TableReserve;

import java.util.List;

public class OrderFoodInfoPresenterImpl implements  OrderFoodInfoPresenter , OrderFoodInfoModel.OnLoadOrderFoodInfoListener{


    private OrderFoodInfoModelImpl model;

    private OrderFoodInfoView orderFoodInfoView;


    public OrderFoodInfoPresenterImpl(OrderFoodInfoView orderFoodInfoView) {
        model = new OrderFoodInfoModelImpl();
        this.orderFoodInfoView=orderFoodInfoView;

    }


    @Override
    public void loadOrderFoodInf(int shopid) {
       // orderFoodInfoView.showProgress("正在查询预定信息列表");
        model.loadOrderFoodInfo( shopid,this);
    }


    @Override
    public void onLoadOrderFoodInfoSuccess(List<TableReserve> tableReserves) {
       //  orderFoodInfoView.dismissProgress();
        orderFoodInfoView.OrderFoodInfoSuccess(tableReserves);
    }

    @Override
    public void onLoadOrderFoodInfoFailure(String errorMsg) {
        orderFoodInfoView.OrderFoodInfoFailure(errorMsg);
    }
}
